package com.hongmeng.teamwork.config;

import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebConfigure implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedHeaders("*", "content-type", "cookie")
                .allowedMethods("*")
                .maxAge(3600)
                .allowCredentials(true)
                // 支持的域
                .allowedOriginPatterns("*")
                .exposedHeaders("Content-Disposition");
    }
}
